package com.parcial.data.entidades;

import java.io.Serializable;
import java.lang.reflect.Field;

import com.parcial.data.util.Clave;

public abstract class Entidad implements Serializable {
	
	private static final long serialVersionUID = 1L;

	public abstract Clave getClave();

	@Override
	public String toString() {
		StringBuilder b = new StringBuilder("[");
		for (Field f : getClass().getDeclaredFields()) {
			f.setAccessible(true);
			try {
				b.append(f.getName() + "=" + f.get(this) + ", ");
			} catch (IllegalAccessException e) {
			}
		}
		b.delete(b.length()-2, b.length()).append("]");
		return b.toString();
	}

}
